package com.huang825172.sbog.MainPage.View;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

public class MainPageFragmentAdapter extends FragmentPagerAdapter {
    private FragmentManager manager;
    private String[] title;
    private List<Fragment> list;

    public MainPageFragmentAdapter(FragmentManager fm, String[] title, List<Fragment> list) {
        super(fm);
        this.manager = fm;
        this.title = title;
        this.list = list;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }

    @Override
    public Fragment getItem(int i) {
        return list.get(i);
    }

    @Override
    public int getCount() {
        return list.size();
    }
}
